<template>
  <div class="space-404">
    <div class="stars"></div>
    <div class="stars2"></div>
    <div class="stars3"></div>

    <div class="content">
      <div class="error-container">
        <div class="error-number">4</div>
        <div class="astronaut-container">
          <div class="astronaut">
            <div class="astronaut-backpack"></div>
            <div class="astronaut-head"></div>
            <div class="astronaut-body"></div>
            <div class="astronaut-leg left"></div>
            <div class="astronaut-leg right"></div>
            <div class="astronaut-arm left">
              <div class="astronaut-hand"></div>
            </div>
            <div class="astronaut-arm right">
              <div class="astronaut-hand"></div>
            </div>
          </div>
        </div>
        <div class="error-number">4</div>
      </div>
      <div class="message">
        <h1>哎呀，您迷失在太空中了</h1>
        <p>抱歉，您访问的页面好像被黑洞吸走了</p>
        <router-link to="/" class="back-btn">返回地球</router-link>
      </div>
    </div>

    <div class="planet"></div>
    <div class="flying-saucer"></div>
  </div>
</template>

<style scoped>
.space-404 {
  position: relative;
  height: 100vh;
  background: linear-gradient(to bottom, #0f2052 0%, #1b3984 50%, #2c5eb9 100%);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 星星背景 */
.stars, .stars2, .stars3 {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  display: block;
  background-size: cover;
}

.stars {
  background-image: radial-gradient(2px 2px at 20px 30px, #fff, rgba(0, 0, 0, 0)),
  radial-gradient(2px 2px at 40px 70px, #fff, rgba(0, 0, 0, 0)),
  radial-gradient(2px 2px at 50px 160px, #fff, rgba(0, 0, 0, 0)),
  radial-gradient(2px 2px at 90px 40px, #fff, rgba(0, 0, 0, 0)),
  radial-gradient(2px 2px at 130px 80px, #fff, rgba(0, 0, 0, 0)),
  radial-gradient(2px 2px at 160px 120px, #fff, rgba(0, 0, 0, 0));
  animation: starsAnimation 50s linear infinite;
}

.stars2 {
  background-image: radial-gradient(2px 2px at 100px 50px, #fff, rgba(0, 0, 0, 0)),
  radial-gradient(2px 2px at 200px 150px, #fff, rgba(0, 0, 0, 0)),
  radial-gradient(2px 2px at 300px 200px, #fff, rgba(0, 0, 0, 0)),
  radial-gradient(2px 2px at 400px 250px, #fff, rgba(0, 0, 0, 0)),
  radial-gradient(2px 2px at 500px 100px, #fff, rgba(0, 0, 0, 0)),
  radial-gradient(2px 2px at 50px 300px, #fff, rgba(0, 0, 0, 0));
  animation: starsAnimation 100s linear infinite;
}

.stars3 {
  background-image: radial-gradient(2px 2px at 150px 150px, #fff, rgba(0, 0, 0, 0)),
  radial-gradient(2px 2px at 250px 250px, #fff, rgba(0, 0, 0, 0)),
  radial-gradient(2px 2px at 350px 350px, #fff, rgba(0, 0, 0, 0)),
  radial-gradient(2px 2px at 450px 450px, #fff, rgba(0, 0, 0, 0)),
  radial-gradient(2px 2px at 550px 550px, #fff, rgba(0, 0, 0, 0)),
  radial-gradient(2px 2px at 650px 650px, #fff, rgba(0, 0, 0, 0));
  animation: starsAnimation 150s linear infinite;
}

/* 内容 */
.content {
  z-index: 1;
  text-align: center;
  color: white;
}

.error-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 30px;
}

.error-number {
  font-size: 150px;
  font-weight: bold;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
  animation: glowAnimation 2s ease-in-out infinite alternate;
}

.astronaut-container {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 0 10px;
  animation: floatAnimation 5s ease-in-out infinite;
}

.astronaut {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  width: 140px;
  height: 200px;
}

.astronaut-backpack {
  position: absolute;
  top: 30px;
  left: 20px;
  width: 100px;
  height: 100px;
  //background-color: #e6e6e6;
  border-radius: 10px;
}

.astronaut-head {
  position: absolute;
  top: 10px;
  left: 35px;
  width: 70px;
  height: 70px;
  background-color: white;
  border-radius: 50%;
  z-index: 1;
  box-shadow: inset -5px 0 15px rgba(0, 0, 0, 0.1);
}

.astronaut-body {
  position: absolute;
  top: 70px;
  left: 30px;
  width: 80px;
  height: 90px;
  background-color: #f5f5f5;
  border-radius: 10px;
}

.astronaut-arm {
  position: absolute;
  top: 90px;
  width: 20px;
  height: 60px;
  background-color: #f5f5f5;
  border-radius: 8px;
}

.astronaut-arm.left {
  left: 15px;
  transform-origin: top center;
  animation: armWave 5s ease-in-out infinite;
}

.astronaut-arm.right {
  right: 15px;
}

.astronaut-hand {
  position: absolute;
  bottom: -10px;
  width: 20px;
  height: 20px;
  background-color: white;
  border-radius: 50%;
}

.astronaut-leg {
  position: absolute;
  bottom: 0;
  width: 24px;
  height: 50px;
  background-color: #f5f5f5;
  border-radius: 8px;
}

.astronaut-leg.left {
  left: 40px;
}

.astronaut-leg.right {
  right: 40px;
}

.message h1 {
  font-size: 32px;
  margin-bottom: 10px;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.message p {
  font-size: 18px;
  margin-bottom: 30px;
  opacity: 0.8;
}

.back-btn {
  display: inline-block;
  padding: 12px 24px;
  background-color: #00a8ff;
  color: white;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 500;
  transition: all 0.3s;
  box-shadow: 0 5px 15px rgba(0, 168, 255, 0.4);
}

.back-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 168, 255, 0.6);
  background-color: #0097e6;
}

/* 行星 */
.planet {
  position: absolute;
  bottom: -100px;
  right: -100px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle at 30% 30%, #b37825, #6b4d1f);
  border-radius: 50%;
  opacity: 0.5;
  box-shadow: inset 0 0 50px rgba(255, 255, 255, 0.2);
}

.flying-saucer {
  position: absolute;
  top: 15%;
  left: 10%;
  width: 80px;
  height: 20px;
  background-color: #cccccc;
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
  animation: flyingSaucer 20s linear infinite;
}

.flying-saucer::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 20px;
  width: 40px;
  height: 15px;
  background-color: #888;
  border-radius: 50% 50% 0 0;
}

/* 动画 */
@keyframes starsAnimation {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 1000px 1000px;
  }
}

@keyframes floatAnimation {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes glowAnimation {
  0% {
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
  }
  100% {
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.9), 0 0 40px rgba(0, 168, 255, 0.8);
  }
}

@keyframes armWave {
  0%, 100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(20deg);
  }
}

@keyframes flyingSaucer {
  0% {
    left: -100px;
    top: 15%;
  }
  25% {
    top: 25%;
  }
  50% {
    top: 10%;
  }
  75% {
    top: 30%;
  }
  100% {
    left: 120%;
    top: 15%;
  }
}

/* 响应式调整 */
@media (max-width: 768px) {
  .error-number {
    font-size: 100px;
  }

  .astronaut-container {
    width: 100px;
    height: 100px;
  }

  .planet {
    width: 200px;
    height: 200px;
  }
}
</style>
